package alp.starcode.nudtportal.framework.mybatis.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.io.Serializable;
import java.math.BigDecimal;

/**
 * <p>
 * nudt_portal_server（服务器状态表）
 * </p>
 *
 * @author xwx
 * @since 2023-08-08
 */
@Data
@EqualsAndHashCode(callSuper = false)
@TableName("nudt_portal_server")
@ApiModel(value = "NudtPortalServer对象", description = "nudt_portal_server（服务器状态表）")
public class NudtPortalServer extends Model<NudtPortalServer> {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "服务器IP")
    @TableId("server_ip")
    private String serverIp;

    @ApiModelProperty(value = "cpu使用")
    @TableField("cpu_usage")
    private BigDecimal cpuUsage;

    @ApiModelProperty(value = "内存使用")
    @TableField("memoryUsage")
    private BigDecimal memoryUsage;

    @ApiModelProperty(value = "创建时间")
    @TableField("create_time")
    private Long createTime;

    @ApiModelProperty(value = "更新时间")
    @TableField("update_time")
    private Long updateTime;

    @ApiModelProperty(value = "cpu是否告警（0：是，1：否）")
    @TableField("cpu_usage_warning")
    private Integer cpuUsageWarning;

    @ApiModelProperty(value = "内存是否告警（0：是，1：否）")
    @TableField("memory_usage_warning")
    private Integer memoryUsageWarning;


    @Override
    protected Serializable pkVal() {
        return this.serverIp;
    }

}
